# PowerShell脚本 - 启动支持手机访问的开发服务器

Write-Host "🚀 启动开发服务器支持手机访问..." -ForegroundColor Green
Write-Host ""

# 获取本机IP地址
$ipAddress = (Get-NetIPAddress -AddressFamily IPv4 | Where-Object {$_.IPAddress -ne "127.0.0.1" -and $_.IPAddress -notlike "169.254.*"} | Select-Object -First 1).IPAddress

if ($ipAddress) {
    Write-Host "📱 手机访问地址: http://$ipAddress:3000" -ForegroundColor Cyan
} else {
    Write-Host "⚠️  无法获取本机IP地址，请手动查看网络配置" -ForegroundColor Yellow
}

Write-Host "💻 电脑访问地址: http://localhost:3000" -ForegroundColor Cyan
Write-Host ""
Write-Host "📋 使用说明:" -ForegroundColor Yellow
Write-Host "1. 确保手机和电脑连接在同一个WiFi网络"
Write-Host "2. 在手机浏览器中输入上面的手机访问地址"
Write-Host "3. 如果无法访问，请检查防火墙设置"
Write-Host ""

# 启动开发服务器
Write-Host "正在启动开发服务器..." -ForegroundColor Green
npm run dev
